-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow hostAliases definition #109
Conversation
Thanks for your PR. Also, we will need to tweak a new release here : https://github.com/georchestra/helm-georchestra/blob/main/Chart.yaml#L18 (you can add it to the PR) I am looking at the templates/_tplvalues.tpl files, and it seems to me overly complex. |
For this file I just picked this one : https://github.com/bitnami/charts/blob/main/bitnami/common/templates/_tplvalues.tpl Most of the comented stuff are documentations on how to use the helper. |
okay, seems overly complex as I said |
I tried the syntax you suggest but I had errors when install the chart, so I finally used the same method I found in bitnami's charts. Maybe I miss something as I'm a beginner with helm charts. |
I succeed to correct it ;) |
hello @jusabatier, May I propose you alternative solutions to your problem. In Kubernetes there exist an object called ExternalName: https://kubernetes.io/docs/concepts/services-networking/service/#externalname. It allows creating hosts aliases for existing external domains. The downside is that you may not be able to define custom IP addresses. This is where you can use Endpoints to your advantage, by combining it with a Service you can achieve the same hosts aliases feature: https://stackoverflow.com/a/57618703 Bonus point is that you can reuse these hosts aliases across all of your applications running in your Kubernetes cluster. Another way in achieving what you want, if you can configure CoreDNS. It is to adapt its configuration by adding a new block called "hosts". This is actually a system plugin of CoreDNS: https://coredns.io/plugins/hosts/ Here is an example, if you are installed CoreDNS with helm:
In conclusion, for me, I don't plan to add this parameter into the helm chat since you can already achieve the same functionality by using native Kubernetes features. |
I also found this solution when I search how to solve my problem, but I think hostAliases are a lot simpler to use as they doesn't need to define additional resources. I don't need/want to define an alias for all pods in my cluster, but only for a namespace (test for example) as I may have to define a different one on other namespaces. HostAlias are also a native kubernetes feature : https://kubernetes.io/docs/tasks/network/customize-hosts-file-for-pods/ |
Hi, Agreed, it adds some complexity to your workflow, but it would do the job. |
Service or ExternalName exist per namespace. You can have one with the same name in different namespace. We thrive to keep this helm chart as simple as possible without adding too many parameters. If a feature can be achieved outside of this helm chart, we prefer to keep it this way. An example is the fact that we made the decision to keep the built-in Ingress simple inside the helm chart. You can see that in bitnami helm chart there is a massive amount of parameters for configuring the ingress: https://github.com/bitnami/charts/blob/3ecd8bd03ceb15b03d06744989dc6aafab51c34d/bitnami/nginx/values.yaml#L746-L834 but we decided to not go this route. At Camptocamp we don't use the built-in ingress, and we have a separate resource for this. @jusabatier Could you try again with a Service or an ExternalName and see if it does solve your problem? You can create a separate internal helm chart for handling such resources. |
I just tried this :
And it doesn't work, it still use the public DNS provided IP. |
If the domain
It is then resolvable through the hostname
Or if the domain
This way it is resolvable at the hostname
But you can't override
In this case, it doesn't make sense to want to override If you can then create a service and endpoints objects like explained in the 2nd suggestion and specify it like this:
|
My usecase is a bit specific and I need to override defined DNS entry as my LDAP accept only SSL connexion on "ldaps://ldap.lepuyenvelay.fr" and this URL is mapped with another IP by the IT dept DNS server. Don't worry, if you don't want to handle |
Ha you should have explained that in the first place! It's a valid use case then. My motto is like explained we avoid implementing things that can be done outside of the chart, but in this case you can't really do it. Could you rebase your changes? We will merge your PR after that. |
Chart.yaml
Outdated
@@ -15,7 +15,7 @@ type: application | |||
# This is the chart version. This version number should be incremented each time you make changes | |||
# to the chart and its templates, including the app version. | |||
# Versions are expected to follow Semantic Versioning (https://semver.org/) | |||
version: 1.2.0 | |||
version: 1.2.1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please don't bump the revision in this commit. I'll do a separate one.
d2a519e
to
0735bb3
Compare
Is it OK for you ? |
I just fixed the CI. And I have added more documentation comments and removed the version bump. Should be good. Waiting for the CI and I'll merge it. |
Just merged. Will do a new release after we have fixed other things. What I would suggest as a last note. Is to have a separate DNS server for your internal network where Because overriding DNS records through It can lead in the far future to confusion, not understanding why some apps use this IP and not the others, for example. |
Available in release 1.3.0 |
In my environment, I need to define some hostAliases for external services like OpenLDAP.
This PR allow to define them in the values.yaml